const express = require('express')
const app = express()

// 跨域设置
app.all("*", function (req, res, next) {
    res.set("Access-Control-Allow-Origin", "*")
    // res.setHeader("Access-Control-Allow-Credentials", true);
    // // res.setHeader("Access-Control-Allow-Origin", req.get("Origin")); // 添加这一行代码，代理配置不成功
    // res.setHeader("Access-Control-Allow-Methods", 'POST, GET, OPTIONS, DELETE, PUT');
    // res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, If-Modified-Since")
    next();

})

app.use(express.static(__dirname))

app.listen(9999, () => {
    console.log('服务运行在9999端口，http://localhost:9999')
})